<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSchoolsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('schools', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment("名称");
            $table->string('pic')->nullable();
            $table->string('address')->comment("地址")->nullable();
            $table->string('phone',25)->nullable();
            $table->text('abstract')->comment("简介")->nullable();
            $table->tinyInteger("isopen")->nullable()->default(1)->comment("是否开启[否,是]");
            $table->tinyInteger("student_num")->nullable()->default(0)->comment("学生数量");
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('schools');
    }
}
